# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
JNI_PATH := $(call my-dir)
LOCAL_PATH := $(JNI_PATH)

include $(call all-makefiles-under,$(LOCAL_PATH))
LOCAL_PATH := $(JNI_PATH)

include $(CLEAR_VARS)
LUA_INC   := ../../../external/lua-5.1.4/src

ZUTIL_INC := ../../include
ZUTIL_SRC := ../../../src/
ZUTIL_FLASG := -DBSTRLIB_DOESNT_THROW_EXCEPTIONS -DZUTIL_OSTYPE=ZUTIL_ANDROID

LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(LUA_INC) $(ZUTIL_INC)
LOCAL_CXX_INCLUDES := $(JNI_H_INCLUDE) $(LUA_INC) $(ZUTIL_INC)

LOCAL_MODULE    := zutil-jni
TARGET_PRELINK_MODULES := false
LOCAL_CFLAGS    := -Werror $(ZUTIL_FLASG)
LOCAL_CPPFLAGS  := -Werror $(ZUTIL_FLASG)

ZUTIL_SRC_FILES := $(ZUTIL_SRC)bstraux.c \
					$(ZUTIL_SRC)bstrlib.c \
					$(ZUTIL_SRC)bstrwrap.cpp \
					$(ZUTIL_SRC)zdc.cpp \
					$(ZUTIL_SRC)zlogger.cpp  \
					$(ZUTIL_SRC)zluaobj.cpp \
					$(ZUTIL_SRC)zobj.cpp \
					$(ZUTIL_SRC)zos.cpp \
					$(ZUTIL_SRC)zstring.cpp \
					$(ZUTIL_SRC)zvar.cpp \
					$(ZUTIL_SRC)zbacktrace_android.c
					
ZUTIL_JNI_FILES := var_jni_utils.cpp
LOCAL_SRC_FILES := zutil-jni.cpp  $(ZUTIL_SRC_FILES) $(ZUTIL_JNI_FILES) 

LOCAL_STATIC_LIBRARIES := liblua51

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

